package cate.game.play.skill.passive.furniture;

import cate.game.play.buff.Buff;
import cate.game.play.config.PlayCfgArgs;
import cate.game.play.proce.action.ctx.ActionCtx;
import cate.game.play.skill.passive.PassiveHandler;

/**
 * 控制目标后100%附加【源泉】2回合不可驱散，友方目标每次攻击附带【源泉】目标时可恢复8%最大生命值,每回合至多生效2次
 */
public class 源泉激励PH extends PassiveHandler {

	private int buff;

	//buff=？？
	@Override
	public void parse(String code) {
		PlayCfgArgs args = new PlayCfgArgs(code);
		buff = args.getInt("buff", 0);
	}

	@Override
	public void onOtherAddBuff(ActionCtx action, Buff otherBuff) {
		if (otherBuff.caster.getPid() != skill.owner.getPid()) {
			return;
		}
		if (!otherBuff.isCtrl()) {
			return;
		}
		otherBuff.owner.buff.tryAddByTid(action, skill.owner, buff);
	}
}
